Inherit stdin when using `cargo run`
authorAlex Crichton <alex@alexcrichton.com>
Sat, 26 Jul 2014 04:10:43 +0000 (21:10 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 26 Jul 2014 04:10:43 +0000 (21:10 -0700)
Previously a pipe was made which could mess with stdin like in #267.

Closes #267

src/cargo/util/process_builder.rs

index fff9cd63b1328eb9a0007de0f15e9666afca9c93..a0322e380bd4b49e61cf5498eca5b17b391f5114 100644 (file)
@@ -56,7 +56,8 @@ impl ProcessBuilder {
     pub fn exec(&self) -> Result<(), ProcessError> {
         let mut command = self.build_command();
         command.stdout(InheritFd(1))
-               .stderr(InheritFd(2));
+               .stderr(InheritFd(2))
+               .stdin(InheritFd(0));
 
         let msg = || format!("Could not execute process `{}`",
                              self.debug_string());